
#include "system.h"
#include "time.h"
#include "utils.h"

#include <attest/attest.h>

/*ATTEST(system, invariant_tsc)
{
  ATTEST_TRUE(pup_is_tsc_invariant());
}*/

/*ATTEST(time, now)
{
  pup_timestamp_now();
}*/

ATTEST(time, now_perf)
{
  pup_timestamp_t before = pup_timestamp_now();
  for(unsigned i = 0; i != 10000; ++i)
    pup_timestamp_now();
  pup_timestamp_t after = pup_timestamp_now();
  pup_timespan_t timespan = pup_timespan_diff(before, after);
  printf("nanos: %f\n", PUP_STATIC_CAST(double, pup_timespan_nanos(&timespan)) / 10000);
}
